home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / vdl020d.zip / VMEM.DOC < prev    next >
Text File  |  1993-04-14  |  3KB  |  96 lines

  1. {
  2.  ════════════════════════════════════════════════════════════════════════════
  3.  
  4.  Visionix Memory Management Unit (VMEM)
  5.  Copyright 1991,92,93 Visionix
  6.  ALL RIGHTS RESERVED
  7.  
  8.  ────────────────────────────────────────────────────────────────────────────
  9.  
  10.  Revision history in reverse chronological order:
  11.  
  12.  Initials  Date      Comment
  13.  ────────  ────────  ────────────────────────────────────────────────────────
  14.  
  15.  mep       02/11/93  Cleaned up code for beta release
  16.  
  17.  jrt       02/08/93  Sync with beta 0.12 release
  18.  
  19.  jrt       12/07/92  Sync with beta 0.11 release
  20.  
  21.  jrt       11/21/92  Sync with beta 0.08
  22.  
  23.  jrt       08/01/92  First logged revision.
  24.  
  25.  ════════════════════════════════════════════════════════════════════════════
  26. }
  27.  
  28. Unit VMem;
  29.  
  30.  
  31. Uses
  32.  
  33.   VTypes;
  34.  
  35. {──────────────────────────────────────────────────────────────────────────────}
  36.  
  37. Const
  38.  
  39.   allocZERO      = $01;
  40.  
  41. Type
  42.  
  43.   TMemHeader = RECORD
  44.  
  45.     Locks    : LONGINT;
  46.     Size     : LONGINT;
  47.     Ptr      : Pointer;
  48.  
  49.   END;
  50.  
  51.   PMemHeader = ^TMemHeader;
  52.  
  53. {──────────────────────────────────────────────────────────────────────────────}
  54.  
  55. Function  VMemAlloc(              Flags          : WORD;
  56.                                   Size           : LONGINT         ):THandle;
  57.  
  58.   { Allocates a memory handle.                                     }
  59.   {                                                                }
  60.   { Flags               Allocation control flags                   }
  61.   {                       allocZERO zero out allocated memory.     }
  62.   {                                                                }
  63.   { [RETURNS]           Memory Handle,                             }
  64.   {                       0 if error.                              }
  65.  
  66.  
  67. Function  VMemLock(               MemHandle      : THandle         ):Pointer;
  68.  
  69.   { Locks down the memory associated with a memory handle, and     }
  70.   { returns a pointer to it.                                       }
  71.   {                                                                }
  72.   { MemHandle           Previously allocated memory handle.        }
  73.   {                                                                }
  74.   { [RETURNS]           Pointer to memory,                         }
  75.   {                       NIL if error.                            }
  76.  
  77.  
  78. Procedure VMemUnlock(             MemHandle      : THandle         );
  79.  
  80.   { Unlocks the memory associated with a memory handle, invaliding }
  81.   { any pointer to the memory previously obtained via VMemLock.    }
  82.   {                                                                }
  83.   { MemHandle           Previously allocated memory handle.        }
  84.   {                                                                }
  85.  
  86.  
  87. Procedure VMemFree(               MemHandle      : THandle         );
  88.  
  89.   { VMemFree frees a memory handle and the memory associated with  }
  90.   { it.                                                            }
  91.   {                                                                }
  92.   { MemHandle           Previously allocated memory handle.        }
  93.  
  94. {──────────────────────────────────────────────────────────────────────────────}
  95.  
  96.